﻿@{
    var user = (V5_Model.ModelGZUser)Session["isLogin"];
    System.Data.DataTable dt = V5.GZProduct.Query_By("*", " and DirectMarketing=1", " CreateDate desc", 0);

    int count = 0;

    bool isLogin = false;

    if (user != null)
    {
        isLogin = true;
    }

    if (dt != null && dt.Rows.Count > 0)
    {
        count = dt.Rows.Count;
    } 
    
}
<div id="hotSale" class="searchColSubItem mt">
    <h2>
        热销商品排行榜</h2>
    <div class="viewAndRank">
        @if (count == 0)
        {
            <div>
                暂无数据</div> 
        }
        else
        {
            var i = 1;
            foreach (System.Data.DataRow item in dt.Rows)
            {
                if (i == 6) { break; } 
            <dl>
                <dt><a id="pdlink22_1086185" href="@V5.Url.Action("Product/View", new { ID = item["ID"].ToString() })" target="_blank" title="@item["ProductName"]">
                    @item["ProductName"]</a></dt>
                <dd class="pic" id="pic_1086185">
                    <a id="pdlink21_1086185" href="@V5.Url.Action("Product/View", new { ID = item["ID"].ToString() })" target="_blank" >
                        <img src="/@item["PicturePath"]" title="@item["ProductName"]">
                    </a><sup @(i>3?"class=gray":"")>@i</sup>
                </dd>
                <dd class="price">
                    <strong id="price2_1086185" productid="1086185">￥@(isLogin ? item["MaxSalePrice"].ToString() : "登陆后查看")</strong> 
                </dd>
            </dl>
        
                i++;
            }
        }
    </div>
</div>
